package com.gxuwz.cyhschool;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import android.content.Intent;

import org.json.JSONObject;

public class unlock extends AppCompatActivity implements View.OnClickListener {

    private EditText kjs_psd;
    public Button kjs_btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_unlock);
        getSupportActionBar().hide();
        kjs_psd = findViewById(R.id.ed_unlock);
        kjs_btn = findViewById(R.id.btn_unlock);
        kjs_btn.setOnClickListener(this);
        ImageView imageView=findViewById(R.id.iv_return);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_return:
                finish();
                break;
            case R.id.btn_unlock:
                if(kjs_psd.getText()==null || kjs_psd.getText().equals("")){
                    Toast.makeText(unlock.this,"请输入密码",Toast.LENGTH_SHORT).show();
                    return;
                }
                Toast.makeText(unlock.this,"解锁成功",Toast.LENGTH_SHORT).show();
                finish();
                break;
        }
    }
}